<template>
  <div id="artist-tab-bar">
    <div
      v-for="(item, index) in tabBarData"
      :key="index"
      :class="{ 'is-active': currentIndex === index }"
      @click="tabBarClick(index)">{{ item }}</div>
  </div>
</template>

<script>
export default {
  name: 'ArtistTabBar',
  props: {
    tabBarData: {
      type: Array,
      default () {
        return []
      }
    },
    currentIndex: {
      type: Number,
      default () {
        return 0
      }
    }
  },
  methods: {
    tabBarClick (index) {
      this.$emit('tabBarClick', index)
    }
  }
}
</script>

<style scoped lang="less">
#artist-tab-bar {
  user-select: none;
  margin-top: 30px;
  width: 100%;
  border-bottom: 1px solid #e1e1e2;
  overflow: hidden;
  > div {
    cursor: pointer;
    margin-right: 60px;
    padding: 0 2px 6px 2px;
    float: left;
    &.is-active {
      color: #c62f2f;
      border-bottom: 5px solid #c62f2f;
    }
    &:nth-of-type(1) {
      margin-left: 80px;
    }
  }
}
</style>
